/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum AllocAccountType implements org.f1x.api.message.types.ByteEnum {
	ACCOUNT_IS_CARRIED_ON_CUSTOMER_SIDE_OF_BOOKS((byte)'1'),
	ACCOUNT_IS_CARRIED_ON_NON_CUSTOMER_SIDE_OF_BOOKS((byte)'2'),
	HOUSE_TRADER((byte)'3'),
	FLOOR_TRADER((byte)'4'),
	ACCOUNT_IS_CARRIED_ON_NON_CUSTOMER_SIDE_OF_BOOKS_AND_IS_CROSS_MARGINED((byte)'6'),
	ACCOUNT_IS_HOUSE_TRADER_AND_IS_CROSS_MARGINED((byte)'7'),
	JOINT_BACKOFFICE_ACCOUNT((byte)'8');

	private final byte code;

	AllocAccountType (byte code) {
		this.code  = code;
	}

	public byte getCode() { return code; }

	public static AllocAccountType parse(String s) {
		switch(s) {
			case "1" : return ACCOUNT_IS_CARRIED_ON_CUSTOMER_SIDE_OF_BOOKS;
			case "2" : return ACCOUNT_IS_CARRIED_ON_NON_CUSTOMER_SIDE_OF_BOOKS;
			case "3" : return HOUSE_TRADER;
			case "4" : return FLOOR_TRADER;
			case "6" : return ACCOUNT_IS_CARRIED_ON_NON_CUSTOMER_SIDE_OF_BOOKS_AND_IS_CROSS_MARGINED;
			case "7" : return ACCOUNT_IS_HOUSE_TRADER_AND_IS_CROSS_MARGINED;
			case "8" : return JOINT_BACKOFFICE_ACCOUNT;
		}
		return null;
	}

}